package com.zhousb.deviceManager.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author ZhouShenBin
 * @date 2024/7/11 10:41
 * @description
 */
@Getter
@AllArgsConstructor
public enum NoticeTypeEnum {
    DEFAULT(-1,"未知","default"),
    STORE_MESSAGE(1,"库存变动","red"),
    ORDER_MESSAGE(2,"订单提交","green"),
    CANCEL_MESSAGE(3,"订单取消","default"),
    DELIVER_MESSAGE(4,"订单发货","blue");

    private final Integer code;
    private final String name;
    private final String color;

    public static NoticeTypeEnum getInstance(Integer code){
        for (NoticeTypeEnum _enum : NoticeTypeEnum.values()) {
            if (_enum.getCode().equals(code)){
                return _enum;
            }
        }
        return DEFAULT;
    }
}
